﻿using System.Collections.Generic;

namespace WJP.ObjectModel
{
    public static class IExtendableExtension
    {
        /// <summary>
        /// 从特定的参数存储器中拷贝所有自定义参数
        /// </summary>
        /// <param name="a"></param>
        /// <param name="target"></param>
        public static void CopyExtendedProperties(this IExtendable a, IExtendable target)
        {
            foreach (KeyValuePair<string, object> extendedProperty in target.GetExtendedProperties())
                a[extendedProperty.Key] = extendedProperty.Value;
        }
    }
}